<template>
  <DetailDescTable ref="DetailDescTable" :title="$tt('label_pack_material_detail')" :descOption="detailDesc"
                   :url="detailUrl" :urlDataHandle="detailUrlDataHandle"/>
</template>

<script>
import DetailDescTable from "../detail_common.vue";
export default {
  name: "detail_material",
  components: {DetailDescTable},
  data() {
    return {
      detailUrl: '/wms-api/base/WmsBasePackMaterialStockRpc/detail.json',
      detailUrlDataHandle: (res) => {
        let {compartmentList, ...descData} = res.data
        return {
          descData, tableData: compartmentList,
        }
      },
      detailDesc: {
        model: [
          {key: 'code', label: 'label_pack_material_code'},
          {key: 'name', label: 'label_pack_material_name'},
          {key: 'status', label: 'label_status', formatter: (r,c,v) => this.$enumShow(v, "BaseContainerStatusEnum")},
          { key: 'containerTypeCode', label: 'label_container_type_code', },
          {key: 'materialTypeCode', label: 'label_pack_material_type_code',},
          { key: 'warehouseCode', label: 'label_warehouse_code', },
          {key: 'material', label: 'label_material',},
          {key: 'shape', label: 'label_shape', formatter: (r,c,v) => this.$enumShow(v, "BaseShapeEnum")},
          {key: 'usage', label: 'label_usage',},
          {key: 'length', label: 'label_length',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'width', label: 'label_width',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'height', label: 'label_height',formatter: (r, c, v, i) => `${v}cm`},
          {key: 'volume', label: 'label_pack_material_volume',formatter: (r, c, v, i) => `${v}m³`},
          {key: 'packVolume', label: 'label_inner_capacity',formatter: (r, c, v, i) => `${v}m³`},
          {key: 'weight',  label: 'label_weight',formatter: (r, c, v, i) => `${v}kg`},
          {key: 'stockQty', label: 'label_stock_count',},
          {key: 'price', label: 'label_unit_price'},
          {key: 'remark', label: 'label_remark',},
          {key: 'barcodeManage', label: 'label_is_barcode_manage',  formatter: (r,c,v) => this.$enumShow(v, "YesOrNoEnum")},
          {key: 'creator', label: 'label_create_user',},
          {key: 'gmtCreate', label: 'label_create_time',  formatter: (r, c, v, i) => this.$dateFormat(v)},
// appendClass: 'input_slot_div_mini'
        ],
      },
    }
  },
  methods: {
    show({title, ...obj}) {
      this.$refs['DetailDescTable'].show(obj)

    },

    hide() {
      this.$refs['DetailDescTable'].hide()
    },

  }
}
</script>

<style scoped>

</style>
